package com.xiaojie.mapper;

import com.xiaojie.entity.user.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @ClassName UserMapper
 * @Description TODO
 * @Author HTGY02
 * @Date 2021/5/21 10:02
 * @Version 1.0
 **/
public interface UserMapper {

    @Select(value="select * from tb_user limit 5")
    List<User> selectAllUser();

    @Insert(value="insert into tb_user values(#{id},#{name},#{age})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    Integer addUser(User user);
}
